package src;

import static org.junit.Assert.*;

import java.awt.Color;

import org.junit.Test;


public class GamePieceTest
{

    @Test
    public void testGamePiece()
    {
        GridLocation loc = new GridLocation( 1, 1, 1, 1 );
        GamePiece piece = new GamePiece( Color.BLUE, loc );
        assertEquals( Color.BLUE, piece.getColor() );
        assertEquals( loc, piece.getLocation() );

    }


    @Test
    public void testGetColor()
    {
        GridLocation loc = new GridLocation( 1, 1, 1, 1 );
        GamePiece piece = new GamePiece( Color.BLUE, loc );
        assertEquals( Color.BLUE, piece.getColor() );

    }


    @Test
    public void testGetLocation()
    {
        GridLocation loc = new GridLocation( 1, 1, 1, 1 );
        GamePiece piece = new GamePiece( Color.BLUE, loc );
        assertEquals( loc, piece.getLocation() );
    }


    @Test
    public void testSetColor()
    {
        Color c = Color.blue;
        GridLocation loc = new GridLocation( 1, 1, 1, 1 );
        GamePiece piece = new GamePiece( c, loc );
        assertEquals( c, piece.getColor() );
    }


    @Test
    public void testEqualsObject()
    {
        GridLocation loc = new GridLocation( 1, 1, 1, 1 );
        GamePiece other = new GamePiece(Color.blue, loc); 
        GamePiece piece = new GamePiece(Color.blue, loc );
        assertEquals(other.getColor(), piece.getColor());
        assertEquals(other.getLocation(), piece.getLocation());

        
    }

}
